<?php
class Category_model extends CI_Model{
	public function getCategories($parent = 0){
		$data = array();
		$this->db->where(array(
										'category_status' => 1,
										'category_parent' => $parent,
									));
		$this->db->order_by('category_order');
		$q = $this->db->get('categories');
									
		if($q->num_rows()){
			$data = $q->result();
		}
		
		$q->free_result();
		return $data;
	}
} 